package cn.progen.constant;


import cn.progen.util.StringUtil;

public class Config {
	public static String FREEMARKER_CONFIG_PATH=System.getProperty("user.dir")+"\\src\\main\\java\\cn\\progen\\tem";
	
	public static class Db{
		public static  String db_name="db_test";
		
	}
	
	public static class Path{
		public static  String BASEURL=System.getProperty("user.dir")+"\\src\\main\\java\\";
		public static  String WEB_PATH=System.getProperty("user.dir")+"\\web-source\\src\\";
		public static  String BASE_PACK="cn.wyd.ibase";

		public static String getBasePack() {
			return BASE_PACK;
		}

		public static  String MODELURL=getBasePack()+".model";
		public static  String MAPPERURL=getBasePack()+".dao";
		public static  String MAPPERXMLURL=BASE_PACK+".xml";

		public static  String CONTROLLERURL=BASE_PACK+".web";
		public static  String SERVICEURL=BASE_PACK+".service";


		public static String getCONTROLLERURL() {
			return BASEURL+ StringUtil.packToPath(CONTROLLERURL)+"\\";
		}

		public static String getSERVICEURL() {
			return BASEURL+StringUtil.packToPath(SERVICEURL)+"\\";
		}
		public static String getBaseurl() {
			return BASEURL;
		}
		public static String getModelurl() {
			return BASEURL+StringUtil.packToPath(MODELURL)+"\\";
		}
		public static String getMapperurl() {
			return BASEURL+ StringUtil.packToPath(MAPPERURL)+"\\";
		}

		public static String getMapperxmlurl() {
			return  System.getProperty("user.dir")+"\\src\\main\\resources\\mapper\\";
		}

		public static void setBASEURL(String BASEURL) {
			Path.BASEURL = BASEURL;
		}

		public static void setWebPath(String webPath) {
			WEB_PATH = webPath;
		}

		public static void setBasePack(String basePack) {
			BASE_PACK = basePack;
			MODELURL=getBasePack()+".model";
			MAPPERURL=getBasePack()+".dao";
			MAPPERXMLURL=BASE_PACK+".xml";
			CONTROLLERURL=BASE_PACK+".web";
			SERVICEURL=BASE_PACK+".service";
		}

		public static void setMODELURL(String MODELURL) {
			Path.MODELURL = MODELURL;
		}

		public static void setMAPPERURL(String MAPPERURL) {
			Path.MAPPERURL = MAPPERURL;
		}

		public static void setMAPPERXMLURL(String MAPPERXMLURL) {
			Path.MAPPERXMLURL = MAPPERXMLURL;
		}

		public static void setCONTROLLERURL(String CONTROLLERURL) {
			Path.CONTROLLERURL = CONTROLLERURL;
		}

		public static void setSERVICEURL(String SERVICEURL) {
			Path.SERVICEURL = SERVICEURL;
		}
	}
	
	
}
